-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Proof of concept non-component-based css prop. #84
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stephenh
changed the title
Proof of concept non-component-based css prop.
feat: Proof of concept non-component-based css prop.
Nov 9, 2022
stephenh
force-pushed
the
fela-css-prop
branch
from
November 14, 2022 21:00
16f92bc
to
e5f44ad
Compare
Another idea for component-less usage: export function FooComponent() {
const css = useTruss();
return <div className={css.mt2.mb3.$} />;
}
|
stephenh
force-pushed
the
fela-css-prop
branch
from
January 24, 2025 16:20
c454741
to
54d5dc4
Compare
homebound-team-bot
pushed a commit
that referenced
this pull request
Jan 24, 2025
# [1.137.0](v1.136.0...v1.137.0) (2025-01-24) ### Features * Proof of concept non-component-based css prop. ([#84](#84)) ([35f420e](35f420e))
🎉 This PR is included in version 1.137.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a spike related to https://dev.to/srmagura/why-were-breaking-up-wiht-css-in-js-4g9b and specifically re "can we get rid of the wrapping
EmotionCssPropInternal
components" that currently are required anytime acss=
prop is used.See reactwg/react-18#110 but it would be great if React had a non-hook way of subscribing to
useInsertionEffect
events, likedocument.addEventElement('insertionEffect", () => ...)
.Misc ideas:
FelaComponent
, to see perf vs. emotionrenderer
directly inline in__jsxDEV
(noFelaComponent
) and 🤷 if the performance of "not usinguseInsertionEffect
really mattersstyle
s would be injected ~randomly after each render and not necessarily at "safe insertion points", which would cause more DOM/CSS recalcs per the React-18 linkinsertionEffect
event/hookstyle
attribute, and skip class names all together (recommended in the react-18 doc as what FB does, but technically only for dynamic styles)FelaComponent
, otherwise use the existing/injected classes directly onclassName
(noFelaComponent
)